﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Helpers
{
    public class ConsulOptions
    {
        public static string SectionName { get; internal set; } = "Consul";
        /// <summary>
        /// consul注册地址
        /// </summary>
        [Required]
        public string url { get; set; } = "http://192.168.0.61:8500";
        /// <summary>
        /// 服务名
        /// </summary>
        public string serviceName { get; set; }
        /// <summary>
        /// 服务名的前缀
        /// </summary>
        public string preServiceName { get; set; }
        /// <summary>
        /// 服务ip
        /// </summary>
        public string serviceIp { get; set; }
        /// <summary>
        /// 服务端口号
        /// </summary>
        public int? servicePort { get; set; }
        /// <summary>
        /// 监控检查终结点
        /// </summary>
        [Required]
        public string httpCheckPath { get; set; } = "/healthz";
        /// <summary>
        /// 获取ip的url
        /// http://192.168.0.57:50170/ip
        /// </summary>
        public string IpParserUrl { get; set; } = "http://192.168.0.57:50170/ip";
        /// <summary>
        /// 延迟多少秒后注册
        /// </summary>
        public int millisecondsDelay { get; set; } = 10_000;
    }
}
